/*******************************************************************************
**
** Copyright (c) 2011 - The OWE Team
**
** This file is part of OWE.
**
** OWE is a free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; version
** version 2.1 of the License.
**
** OWE is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with OWE. If not, see <http://www.gnu.org/licenses/>.
**
*******************************************************************************/

#include <owe/node.h>

#include "utests.h"

OWE_USE_NAMESPACE

FakeNode::FakeNode(const char *name, const char *data)
    : m_name(name)
    , m_data(data)
{
}

FakeNode::~FakeNode()
{
    m_attribute.clear();
}

UString FakeNode::attribute(const char *attributeName) const
{
    const std::map<UString, UString>::const_iterator it = m_attribute.find(attributeName);

    if (it != m_attribute.end())
        return it->second;

    return UString();
}

void FakeNode::addAttribute(const char *attribute, const char *value)
{
    m_attribute[attribute] = value;
}
